#pragma once
#include <boost/noncopyable.hpp>

namespace he
{
	//! Animation controller implementation.
	class AnimationController : boost::noncopyable
	{
		// Attributes
	private:
		//! Root bone.
		Ogre::Bone *m_pRootBone;
		//! Animation.
		Ogre::Animation *m_pAnimation;
		//! Animation state.
		Ogre::AnimationState *m_pAnimationState;
		//! Animation track.
		Ogre::NodeAnimationTrack *m_pAnimationTrack;
		//! Last time position.
		float m_LastTimePosition;
		//! Last position.
		Ogre::Vector3 m_LastPosition;
		//! Start position.
		Ogre::Vector3 m_StartPostion;
		//! Position in previous update.
		Ogre::Vector3 m_PreviousPosition;
		//! Axis orientation in previous update.
		Ogre::Vector3 m_PreviousAxis;
		//! Node to which entity is attached.
		Ogre::SceneNode *m_pSceneNode;
		//! Control movement of scene node.
		bool m_ControlMove;
		//! Control rotation of scene node.
		bool m_ControlRotation;
		
		// Operations
	public:
		//! Update animation.
		void update(float Delta);
		//! Has animation ended.
		bool has_ended() const;

		// Construction/Destruction
	public:
		AnimationController(std::string const &Animation, Ogre::Entity *pEntity, Ogre::SceneNode *pSceneNode, bool ControlMove, bool ControlRotation, bool Enabled = true);
	};
} /*he*/
